package org.jwcloud.project.module.zx.projectFollow.controller;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.jwcloud.project.module.zx.common.Resp;
import org.jwcloud.project.module.zx.common.repository.RptCommonRepository;
import org.jwcloud.project.module.zx.projectFollow.service.ProjectFollowService;
import org.jwcloud.project.module.zx.template.service.RptTemplateService;
import org.jwcloud.project.module.zx.timingAnalyse.service.DoingAnalyseService;
import org.jwcloud.project.module.zx.timingAnalyse.service.TimingAnalyseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.jw.mid.mm.comm.common.controller.BaseController;
import com.jw.mid.mm.comm.common.controller.CrudController;
import com.jw.mid.mm.comm.common.json.Response;
import com.jw.mid.mm.comm.common.pagination.ListBounds;
import com.jw.mid.mm.comm.common.pagination.ListSlice;
import com.jw.mid.mm.comm.common.pagination.Pagination;
import com.jw.mid.mm.comm.common.service.CrudService;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;

@Api(value = "API - Controlle",
description = "项目进度跟踪", tags = "ProjectFollow")
@RestController
@RequestMapping("/rest/projectFollow")
public class ProjectFollowController extends BaseController{
	
//	@Autowired
//    private CommonService commonService;
	 
	@Autowired
    private ProjectFollowService projectFollowService;
	
    //------------
    @GetMapping("queryList")
    @ApiOperation(value = "查询列表", notes = "")
    @ApiImplicitParams({
    	@ApiImplicitParam(name = "project_name", value = "名字", required = false, dataType = "string", paramType = "query"),
    	@ApiImplicitParam(name = "start_start_time", value = "开始开始时间 yyyy-mm-dd", required = false, dataType = "string", paramType = "query"),
    	@ApiImplicitParam(name = "start_end_time", value = "开始结束时间", required = false, dataType = "string", paramType = "query"),
    	@ApiImplicitParam(name = "end_start_time", value = "结束开始时间", required = false, dataType = "string", paramType = "query"),
    	@ApiImplicitParam(name = "end_end_time", value = "结束结束时间", required = false, dataType = "string", paramType = "query"),
    	@ApiImplicitParam(name = "app_phase", value = "项目阶段", required = false, dataType = "string", paramType = "query"),
    	
    	@ApiImplicitParam(name = "sp_start_time", value = "审批开始时间", required = false, dataType = "string", paramType = "query"),
    	@ApiImplicitParam(name = "sp_end_time", value = "审批结束时间", required = false, dataType = "string", paramType = "query"),
    	
    	@ApiImplicitParam(name = "guidang_start_time", value = "归档开始时间", required = false, dataType = "string", paramType = "query"),
    	@ApiImplicitParam(name = "guidang_end_time", value = "归档结束时间", required = false, dataType = "string", paramType = "query"),
    	
    	@ApiImplicitParam(name = "guidang_state", value = "是否归档  99归档；10正常", required = false, dataType = "string", paramType = "query"),
    	@ApiImplicitParam(name = "pagi", value = "分页参数 currentPage pagisize...", required = false, dataType = "string", paramType = "query"),
    })
    public Resp<Object> queryList(
    		Pagination pagination, 
    		@RequestParam(required = false) Map<String,String> param
    		){
    	System.out.println("param: ----------- " + param);
        return projectFollowService.queryList(pagination, param);
    }
    
    @GetMapping("queryFollow")
    @ApiOperation(value = "查询进度", notes = "")
    @ApiImplicitParams({
    	@ApiImplicitParam(name = "project_id", value = "项目编码", required = true, dataType = "string", paramType = "query"),
    })
    public Resp<Object> queryFollow(
    		@RequestParam(required = false) Map<String,String> param
    		){
        return projectFollowService.queryFollow(param);
    }
    
    @GetMapping("queryList_test")
    @ApiOperation(value = "查询列表 测试", notes = "")
    @ApiImplicitParams({
    })
    public Resp<Object> queryList_test(
    		@RequestParam(required = false) Map<String,String> param
    		){
    	System.out.println("param: ----------- " + param);
        return Resp.success(123);
    }
    
}